Class HCC.DT.HCC2HL72.QP.NewCheckRequst.Backup Extends Ens.DataTransformDTL [ DependsOn = (EnsLib.EDI.XML.Document, EnsLib.HL7.Message) ]
{

Parameter IGNOREMISSINGSOURCE = 1;

Parameter REPORTERRORS = 1;

Parameter TREATEMPTYREPEATINGFIELDASNULL = 0;

XData DTL [ XMLNamespace = "http://www.intersystems.com/dtl" ]
{
<transform sourceClass='EnsLib.EDI.XML.Document' targetClass='EnsLib.HL7.Message' sourceDocType='POOR_IN200901UV:POOR_IN200901UV' targetDocType='2.5.1:ORM_O01' create='new' language='objectscript' >
<annotation>backup for HCC to HL7v2 transformation</annotation>
<assign value='source.{id(1).extension}' property='target.{MSH:MessageControlID}' action='set' />
<assign value='"ORM"' property='target.{MSH:MessageType.MessageCode}' action='set' />
<assign value='"O01"' property='target.{MSH:MessageType.TriggerEvent}' action='set' />
<assign value='source.{creationTime(1).value}' property='target.{MSH:DateTimeOfMessage.Time}' action='set' />
<assign value='source.{controlActProcess(1).subject(1).choice.observationRequest(1).text.value}' property='target.{ORCgrp(1).OBRuniongrp.NTE(1):Comment(1)}' action='set' />
<assign value='source.{controlActProcess(1).subject().choice.observationRequest(1).statusCode(1).code}' property='target.{ORCgrp(1).ORC:OrderStatus}' action='set' />
<assign value='source.{controlActProcess(1).subject(1).choice.observationRequest(1).effectiveTime.validTimeHigh}' property='target.{ORCgrp(1).ORC:OrderEffectiveDateTime.Time}' action='set' />
<assign value='source.{controlActProcess(1).subject(1).choice.observationRequest(1).priorityCode.code}' property='target.{ORCgrp(1).OBRuniongrp.OBRunion.OBR:PriorityOBR}' action='set' />
<assign value='source.{controlActProcess(1).subject(1).choice.observationRequest(1).specimen().choice.specimen(1).code(1).displayName.value}' property='target.{ORCgrp(1).OBRuniongrp.OBRunion.OBR:SpecimenSource}' action='set' />
<assign value='source.{controlActProcess(1).subject(1).choice.observationRequest(1).author.time.value}' property='target.{ORCgrp(1).OBRuniongrp.OBRunion.OBR:RequestedDateTime}' action='set' />
<assign value='source.{controlActProcess(1).subject(1).choice.observationRequest(1).id(1).item(1).extension}' property='target.{ORCgrp(1).ORC:PlacerOrderNumber}' action='set' />
<assign value='source.{controlActProcess(1).subject(1).choice.observationRequest(1).author.assignedEntity(1).id.item(1).extension}' property='target.{ORCgrp(1).ORC:OrderingProvider(1).IDNumber}' action='set' />
<assign value='source.{controlActProcess(1).subject(1).choice.observationRequest(1).author.signatureText.value}' property='target.{ORCgrp(1).ORC:OrderingProvider(1).GivenName}' action='set' />
<assign value='##class(HCC.Utils.Functions).GetDataByXPath(source.{controlActProcess(1).subject(1).choice.observationRequest(1).author.assignedEntity(1).choice.assignedPerson.name(1)})' property='target.{ORCgrp(1).ORC:OrderingProvider(1).FamilyName}' action='set' />
<assign value='##class(HCC.Utils.Functions).GetDataByXPath(source.{controlActProcess(1).subject(1).choice.observationRequest(1).verifier(1).assignedEntity(1).choice.assignedPerson.name(1)})' property='target.{ORCgrp(1).ORC:VerifiedBy(1).GivenName}' action='set' />
<assign value='source.{controlActProcess(1).subject(1).choice.observationRequest(1).author.assignedEntity(1).representedOrganization.id(1).item(1).root}' property='target.{ORCgrp(1).ORC:EnteringOrganization.Identifier}' action='set' />
<assign value='source.{controlActProcess(1).subject(1).choice.observationRequest(1).verifier(1).time.value}' property='target.{ORCgrp(1).ORC:VerifiedBy(1).EffectiveDate}' action='set' />
<assign value='source.{controlActProcess(1).subject(1).choice.observationRequest(1).verifier(1).assignedEntity(1).id.item(1).extension}' property='target.{ORCgrp(1).ORC:VerifiedBy(1).IDNumber}' action='set' />
<assign value='source.{controlActProcess(1).subject(1).choice.observationRequest(1).component2(1).choice.observationRequest(1).id(1).item(1).extension}' property='target.{ORCgrp(1).OBRuniongrp.OBRunion.OBR:SetIDOBR}' action='set' />
<assign value='source.{controlActProcess(1).subject(1).choice.observationRequest(1).component2(1).choice.observationRequest(1).code(1).code}' property='target.{ORCgrp(1).OBRuniongrp.OBRunion.OBR:UniversalServiceIdentifier.Identifier}' action='set' />
<assign value='source.{controlActProcess(1).subject(1).choice.observationRequest(1).component2(1).choice.observationRequest(1).code(1).displayName.value}' property='target.{ORCgrp(1).OBRuniongrp.OBRunion.OBR:UniversalServiceIdentifier.Text}' action='set' />
<assign value='source.{controlActProcess(1).subject(1).choice.observationRequest(1).component2(1).choice.observationRequest(1).methodCode.item(1).code}' property='target.{ORCgrp(1).OBRuniongrp.OBRunion.OBR:ProcedureCode.Identifier}' action='set' />
<assign value='source.{controlActProcess(1).subject(1).choice.observationRequest(1).component2(1).choice.observationRequest(1).methodCode.item(1).displayName.value}' property='target.{ORCgrp(1).OBRuniongrp.OBRunion.OBR:ProcedureCode.Text}' action='set' />
<assign value='source.{controlActProcess(1).subject(1).choice.observationRequest(1).component2(1).choice.observationRequest(1).location(1).time.any.value}' property='target.{ORCgrp(1).OBRuniongrp.OBRunion.OBR:ObservationDateTime.Time}' action='set' />
<assign value='source.{controlActProcess(1).subject(1).choice.observationRequest(1).component2(1).choice.observationRequest(1).location(1).time.any.value}' property='target.{ORCgrp(1).OBRuniongrp.OBRunion.OBR:ScheduledDateTime.Time}' action='set' />
<assign value='"LAB"' property='target.{ORCgrp().ORC:OrderType}' action='set' />
<assign value='source.{controlActProcess(1).subject(1).choice.observationRequest(1).componentOf1.encounter(1).id(1).item(1).extension}' property='target.{PIDgrp.PV1grp.PV1:VisitNumber.IDNumber}' action='set' />
<assign value='source.{controlActProcess(1).subject(1).choice.observationRequest(1).componentOf1.encounter(1).code.code}' property='target.{PIDgrp.PV1grp.PV1:AdmissionType}' action='set' />
<assign value='source.{controlActProcess(1).subject(1).choice.observationRequest(1).componentOf1.encounter(1).code.code}' property='target.{PIDgrp.PV1grp.PV1:PatientClass}' action='set' />
<assign value='source.{controlActProcess(1).subject(1).choice.observationRequest(1).componentOf1.encounter(1).location(1).serviceDeliveryLocation(1).location.asLocatedEntityPartOf(1).location(1).id.item(1).extension}' property='target.{PIDgrp.PV1grp.PV1:AssignedPatientLocation.Room}' action='set' />
<assign value='##class(HCC.Utils.Functions).GetDataByXPath(source.{controlActProcess().subject().choice.observationRequest().componentOf1.encounter().location().serviceDeliveryLocation().serviceProviderOrganization.name})' property='target.{PIDgrp.PV1grp.PV1:AssignedPatientLocation.Facility}' action='set' />
<assign value='##class(HCC.Utils.Functions).GetDataByXPath(source.{controlActProcess(1).subject(1).choice.observationRequest(1).componentOf1.encounter(1).subject(1).patient(1).choice.patientPerson.telecom},"//s:item/@value")' property='target.{PIDgrp.PID:PhoneNumberHome(1).TelephoneNumber}' action='set' />
<assign value='##class(HCC.Utils.Functions).GetDataByXPath($P(source.{controlActProcess(1).subject(1).choice.observationRequest(1).effectiveTime},"&gt;")_"&gt;","//s:low/@value")' property='target.{ORCgrp(1).ORC:QuantityTiming(1).StartDateTime}' action='set' />
<assign value='##class(HCC.Utils.Functions).GetDataByXPath($P(source.{controlActProcess(1).subject(1).choice.observationRequest(1).effectiveTime},"&gt;",2)_"&gt;","//s:high/@value")' property='target.{ORCgrp(1).ORC:QuantityTiming(1).EndDateTime}' action='set' />
<assign value='"2.5"' property='target.{MSH:VersionID}' action='set' />
<assign value='##class(HCC.Utils.Functions).GetDataByXPath(source.{controlActProcess(1).subject(1).choice.observationRequest(1).componentOf1.encounter(1).subject(1).patient(1).choice.patientPerson.addr})' property='target.{PIDgrp.PID:PatientAddress(1)}' action='set' />
<assign value='source.{controlActProcess().subject().choice.observationRequest().componentOf1.encounter().location().serviceDeliveryLocation().location.id.item().extension}' property='target.{PIDgrp.PV1grp.PV1:AssignedPatientLocation.Bed}' action='set' />
<assign value='source.{controlActProcess(1).subject(1).choice.observationRequest(1).componentOf1.encounter(1).subject(1).patient(1).id.item(1).extension}' property='target.{PIDgrp.PID:PatientID}' action='set' />
<assign value='source.{controlActProcess(1).subject(1).choice.observationRequest(1).componentOf1.encounter(1).subject(1).patient(1).choice.patientPerson.id.item(1).extension}' property='target.{PIDgrp.PID:PatientIdentifierList(1).IDNumber}' action='set' />
<assign value='source.{controlActProcess(1).subject(1).choice.observationRequest(1).component2(1).choice.observationRequest(1).componentOf1.encounter(1).subject(1).patient(1).choice.patientPerson.id.item(1).root}' property='target.{PIDgrp.PID:PatientIdentifierList(1).IdentifierTypeCode}' action='set' />
<assign value='source.{controlActProcess(1).subject(1).choice.observationRequest(1).componentOf1.encounter(1).subject(1).patient(1).choice.patientPerson.administrativeGenderCode.code}' property='target.{PIDgrp.PID:AdministrativeSex}' action='set' />
<assign value='source.{controlActProcess(1).subject(1).choice.observationRequest(1).componentOf1.encounter(1).subject(1).patient(1).choice.patientPerson.birthTime.value}' property='target.{PIDgrp.PID:DateTimeofBirth}' action='set' />
<assign value='##class(HCC.Utils.Functions).GetDataByXPath(source.{controlActProcess(1).subject(1).choice.observationRequest(1).componentOf1.encounter(1).subject(1).patient(1).choice.patientPerson.name})' property='target.{PIDgrp.PID:PatientName(1)}' action='set' />
<assign value='source.{controlActProcess(1).subject(1).choice.observationRequest(1).componentOf1.encounter(1).pertinentInformation1(1).observationDx(1).code(1).displayName.value}' property='target.{ORCgrp(1).OBRuniongrp.DG1(1):DiagnosisType}' action='set' />
<assign value='source.{controlActProcess(1).subject(1).choice.observationRequest(1).componentOf1.encounter(1).pertinentInformation1(1).observationDx(1).value(1).code}' property='target.{ORCgrp(1).OBRuniongrp.DG1(1):DiagnosisCodeDG1}' action='set' />
<assign value='source.{controlActProcess(1).subject(1).choice.observationRequest(1).componentOf1.encounter(1).pertinentInformation1(1).observationDx(1).value(1).displayName.value}' property='target.{ORCgrp(1).OBRuniongrp.DG1(1):DiagnosisDescription}' action='set' />
</transform>
}

}
